#include "gu_render_mesh.h"

namespace gu{

    
class DummyRenderMesh : public RenderMesh
{
public:
    DummyRenderMesh();

    VertexBuffer* vertexBuffer() override;
    void vertexBuffer(VertexBuffer* buffer) override;

    IndexBuffer* indexBuffer() override;
    void indexBuffer(IndexBuffer* buffer) override;

private:
    VertexBuffer* vertexBuffer_;
    IndexBuffer* indexBuffer_;
};


/* BufferComposite */
DummyRenderMesh::DummyRenderMesh():vertexBuffer_(nullptr), indexBuffer_(nullptr)
{}

VertexBuffer* DummyRenderMesh::vertexBuffer(){return vertexBuffer_;}

void DummyRenderMesh::vertexBuffer(VertexBuffer* buffer)
{
    vertexBuffer_ = buffer;
}
IndexBuffer* DummyRenderMesh::indexBuffer(){return indexBuffer_;}

void DummyRenderMesh::indexBuffer(IndexBuffer* buffer)
{
    indexBuffer_ = buffer;
}


RenderMesh* newDummyRenderMesh(VertexBuffer* vertexBuffer, IndexBuffer* indexBuffer)
{
    DummyRenderMesh* mesh = new DummyRenderMesh();
    mesh->vertexBuffer(vertexBuffer);
    mesh->indexBuffer(indexBuffer);
    return dynamic_cast<RenderMesh*>(mesh);
}



}// namespace gu